package com.im.partchat.mvp.model.news;

import com.im.partchat.bean.main.MainNewData;
import com.im.partchat.bean.reponsed.BaseResponse;
import com.im.partchat.bean.request.RequestBean;
import com.im.partchat.http.PageInfo;
import com.im.partchat.http.service.NewsService;

import java.util.List;

import io.reactivex.Observable;

/**
 * Created by flyou on 2017/6/30.
 * VersionCode: 1
 * Desc:
 */

public class NewsModelImpl implements NewsModel {
    @Override
    public Observable<BaseResponse<List<Object>>> getNews(@RequestBean.COLUMN String column, int pageNo) {
        RequestBean<String> requestBean = new RequestBean<>();
        requestBean.setColumn(column);
        requestBean.setPageInfo(new PageInfo(pageNo,10,0));
        return NewsService.getNews(requestBean);
    }

    @Override
    public Observable<BaseResponse<MainNewData>> getMainNew() {
        RequestBean<String> requestBean = new RequestBean<>();
        requestBean.setColumn(RequestBean.COLUMN_SY);
        requestBean.setPageInfo(new PageInfo(1,10,0));
        return NewsService.getMainNews(requestBean);
    }
}
